package oops.innerclasses;

public class ClassEnclosingStaticNestedClass {
	
	private static String staticStr = "STATIC-ENCLOSINGCLASS";
	private int i = 0;
	private char ch = 'p';
	private String str = "ENCOSING-CLASS";
	
	static class AStaticNestedClass {
		public void process() {
			ClassEnclosingStaticNestedClass.staticStr = "STATIC-NESTEDCLASS";
			
			// Not allowed; Static methods cannot reference non-static types
			// i = 45;
		}
	}
	
	public void printData() {
		System.out.println("\n\nDATA: "
				+ "i = " + i
				+ "\tch = " + ch
				+ "\tstr = " + str
				+ "\tstaticStr = " + staticStr
		);
	}

	public static void main(String[] args) {
		ClassEnclosingStaticNestedClass cl = new ClassEnclosingStaticNestedClass();
		cl.printData();

		AStaticNestedClass aStaticNestedClass = new ClassEnclosingStaticNestedClass.AStaticNestedClass();
		aStaticNestedClass.process();
		
		cl.printData();
	}

}
